package com.lagou.es.repository;

/**
 * @BelongProject: ElasticSearchDemo
 * @author: 胡恺恺
 * @createTime: 2021/2/1  20:46
 * @Description:
 */

import com.lagou.es.pojo.Product;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * 当SDE访问索引库时,需要定义一个持久层的接口去继承ElasticsearchRepository接口即可，无需实现
 */
public interface ProductRepository extends ElasticsearchRepository<Product,Long> {

    /**
     * 按照价格范围查询
     * @param from
     * @param to
     * @return
     */
    List<Product> findByPriceBetween(Double from, Double to);
}
